package com.auction.controller.admin;

import com.auction.dto.BidPageQueryDTO;
import com.auction.pojo.PageResult;
import com.auction.pojo.Result;
import com.auction.service.BidService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 管理端竞价控制器
 */
@Slf4j
@RestController("adminBidController")
@RequestMapping("/admin/bid")
public class BidController {

    @Autowired
    private BidService bidService;

    /**
     * 分页查询所有竞价记录
     * @param bidPageQueryDTO
     * @return
     */
    @GetMapping("/page")
    public Result<PageResult> page(BidPageQueryDTO bidPageQueryDTO){
        log.info("分页查询竞价列表：");
        PageResult pageResult = bidService.pageQuery(bidPageQueryDTO);
        return Result.success(pageResult);
    }
}
